From aadfc97676597ad58088605c7782ec6a5956de95 Mon Sep 17 00:00:00 2001 From: "vhanquez@kneesa.uk.xensource.com" Date: Thu, 23 Feb 2006 17:14:55 +0000 Subject: [PATCH] initialize few structure fully to zero with talloc_zero instead of explicitely initializing some fields to NULL. Signed-off-by: Vincent Hanquez --- tools/xenstore/xenstored_core.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tools/xenstore/xenstored_core.c b/tools/xenstore/xenstored_core.c index 2dbcaced5d..f9629626d9 100644 --- a/tools/xenstore/xenstored_core.c +++ b/tools/xenstore/xenstored_core.c @@ -573,14 +573,11 @@ static struct buffered_data *new_buffer(void *ctx) { struct buffered_data *data; - data = talloc(ctx, struct buffered_data); + data = talloc_zero(ctx, struct buffered_data); if (data == NULL) return NULL; data->inhdr = true; - data->used = 0; - data->buffer = NULL; - return data; } @@ -1394,17 +1391,13 @@ static void manual_node(const char *name, const char *child) struct node *node; struct xs_permissions perms = { .id = 0, .perms = XS_PERM_NONE }; - node = talloc(NULL, struct node); + node = talloc_zero(NULL, struct node); node->name = name; node->perms = &perms; node->num_perms = 1; - node->data = NULL; - node->datalen = 0; node->children = (char *)child; if (child) node->childlen = strlen(child) + 1; - else - node->childlen = 0; if (!write_node(NULL, node)) barf_perror("Could not create initial node %s", name); -- 2.30.2